const PREFIX = 'weibo'
const WeiboTypes = {
  set_init: PREFIX + 'set_init',
  set_loading: PREFIX + 'set_loading',
  set_users: PREFIX + 'set_users',
  set_articles: PREFIX + 'set_articles',
  set_comments: PREFIX + 'set_comments',
  set_select: PREFIX + 'set_select',
  set_show: PREFIX + 'set_show'
}

const setInit = () => {
  return {
    type: WeiboTypes.set_init
  }
}

const setLoading = (type, bool) => {
  return {
    type: WeiboTypes.set_loading,
    loading: bool,
    loadingType: type
  }
}

const setShow = (type, bool) => {
  return {
    type: WeiboTypes.set_show,
    show: bool,
    showType: type
  }
}

const setSelect = (type, id) => {
  return {
    type: WeiboTypes.set_select,
    selectId: id,
    selectType: type
  }
}



const setUsers = (users) => {
  return {
    type: WeiboTypes.set_users,
    users: users
  }
}

const setArticles = (articles) => {
  return {
    type: WeiboTypes.set_articles,
    articles: articles
  }
}

const setCommets = (comments) => {
  return {
    type: WeiboTypes.set_comments,
    comments: comments
  }
}


module.exports = {
  WeiboTypes,
  setLoading,
  setUsers,
  setArticles,
  setCommets,
  setShow,
  setSelect,
  setInit
}
